import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../page/client/Home'
// 后台管理系统路由
import adminHome from '../page/admin/adminHome'
import adminUser from '../page/admin/adminUser'
import adminClassify from '../page/admin/adminClassify'
import adminFood from '../page/admin/adminFood'
import adminOrder from '../page/admin/adminOrder'
import adminNotice from '../page/admin/adminNotice'


// 客户端路由
import foodList from '../page/client/foodList'
import register from '../page/client/register'
import foodDetail from '../page/client/foodDetail'
import login from '../page/login'
import order from '../page/client/order'
import notice from '../page/client/notice'
import orderList from '../page/client/orderList'



// 后台管理


Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: login,
  },
  {
    path: '/',
    name: 'Home',
    component: Home,
    children: [
      {
        // 菜单列表
        path: '/foodList',
        component: foodList,
        name:foodList
      },
      {
        // 到访登记
        path: '/register',
        name: 'register',
        component: register,
      },
      {
        // 菜单详情
        path: '/foodDetail',
        name: 'foodDetail',
        component: foodDetail,
      },
      {
        // 订单详情
        path: '/order',
        component: order,
      },
      {
        // 订单列表
        path: '/orderList',
        component: orderList,
      },
      {
        // 公告
        path: '/notice',
        component: notice,
      },
    ]
  },
  {
    path: '/adminHome',
    name: 'adminHome',
    component: adminHome,
    children: [
      {
        // 订单管理
        path: '/adminOrder',
        component: adminOrder,
      },
      {
        // 用户管理
        path: '/adminUser',
        component: adminUser,
      },
      {
        // 分类管理
        path: '/adminClassify',
        component: adminClassify,
      },
      {
        // 菜品管理
        path: '/adminFood',
        component: adminFood,
      },
      {
        // 公告管理
        path: '/adminNotice',
        component: adminNotice,
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
